const proxy = require('http-proxy-middleware');
module.exports = function (app) { 
    app.use(proxy('/api', { 
        target: 'https://kyfw.12306.cn',     //要代理的域名
        pathRewrite: {'^/api' : ''},                //重写域名将api替换为空
        changeOrigin: true,                        //target可以使用域名
        secure: false                                   //为false 时可以代理https
     })); 
};